import type { NextApiRequest, NextApiResponse } from 'next';
import { BeError, BeSuccess, ResponseDataType } from '@/utils/response';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
  if (req.method?.toLocaleLowerCase() !== 'post') {
    res.status(200).json(BeError('不支持请求类型'));
    res.end();
    return;
  }
  try {
    res.status(200).json(BeSuccess({ name: 'zmy' }));
    // const { body } = req;
    // try {
    //   const result = await handleLogin(body);
    //   res.status(200).json(BeSuccess(result));
    // } catch (error: any) {
    //   res.status(500).json(BeError(error));
    // }
  } catch (err) {
    res.status(200).json(BeError(err));
    res.end();
  }
}
